/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

.ouiContextMenuItem {
  display: block;
  padding: $ouiSizeM;
  width: 100%;
  text-align: left;
  color: $ouiTextColor;
  outline-offset: -$ouiFocusRingSize;

  &:hover,
  &:focus {
    text-decoration: underline;
  }

  &:focus {
    background-color: $ouiFocusBackgroundColor;
  }

  &.ouiContextMenuItem-isDisabled {
    color: $ouiButtonColorDisabledText;
    cursor: default;

    &:hover,
    &:focus {
      text-decoration: none;
    }
  }

  &--small {
    padding: ($ouiSizeS * .75) $ouiSizeS;

    .ouiContextMenuItem__text {
      @include ouiFontSizeS;
    }
  }
}

.ouiContextMenuItem__inner {
  display: flex;
}

.ouiContextMenuItem__text {
  flex-grow: 1;
  overflow: hidden; // allows for text truncation
}

.ouiContextMenuItem__arrow {
  align-self: flex-end;
}

.ouiContextMenu__itemLayout {
  display: flex;
  align-items: center;

  &.ouiContextMenu__itemLayout--bottom {
    align-items: flex-end;
  }

  &.ouiContextMenu__itemLayout--top {
    align-items: flex-start;
  }

  .ouiContextMenu__icon {
    flex-shrink: 0;
  }
}
